#include<iostream>
#include<string>
#include<stack>
using namespace std;
string s;
stack<char>stk, temp;
int main()
{
	while (cin >> s) {
		while (!stk.empty()) {
			stk.pop();
		}
		for (int i = 0; i < s.size(); i++) {
			char ch = s[i];
			if (stk.empty()) {
				stk.push(ch);
				continue;
			}
			bool flag = 0;
			char top = stk.top();
			while (ch == top) {
				if (ch == 'o') {
					stk.pop();
					ch = 'O';
				}
				else {
					stk.pop();
					flag = 1;
					break;
				}
				if (stk.empty()) {
					break;
				}
				top = stk.top();
			}
			if (!flag) {
				stk.push(ch);
			}
		}
		//cout << stk.size() << endl;
		while (!stk.empty()) {
			temp.push(stk.top());
			stk.pop();
		}
		while (!temp.empty()) {
			cout << temp.top();
			temp.pop();
		}
		cout << endl;
	}
	return 0;
}